package com.hzw.saas.service.rss.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzw.saas.service.rss.model.JournalArticle;
import com.hzw.saas.service.rss.model.JournalUserAxis;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 期刊摘要
 Mapper 接口
 * </p>
 *
 * @author sonam
 * @since 2021-06-30
 */
@Mapper
public interface JournalUserAxisMapper extends BaseMapper<JournalUserAxis> {

    @Delete("<script> delete from tb_journal_user_axis where user_id = #{userId}</script>")
    void deleteByUserId(@Param("userId") String userId);

    @Delete("<script> delete from tb_journal_user_axis where pid = #{pid}</script>")
    void deleteByPid(@Param("pid") String pid);

    @Delete("<script> delete from tb_journal_user_axis where user_id = #{userId} and journal_id in <foreach item=\"pid\" collection=\"pids\"  open=\"(\" separator=\",\" close=\")\"> #{pid} </foreach></script>")
    void deleteByUserIdAndJournalIds(@Param("userId")String userId, @Param("pids") List<String> pids);
}
